home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11518 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  53 lines

  1. Path: netnews.worldnet.att.net!newsadm
  2. From: dslayer@worldnet.att.net (Raymond Joh)
  3. Newsgroups: comp.lang.c
  4. Subject: Newbie needs help w/ARGV ARGC
  5. Date: Mon, 25 Mar 1996 00:46:12 GMT
  6. Organization: AT&T WorldNet Services
  7. Message-ID: <4j4ja1$dc3@mtinsc01-mgt.ops.worldnet.att.net>
  8. NNTP-Posting-Host: 137.atlanta-2.ga.dial-access.att.net
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. I have spent three days attempting to determine why my command line
  12. arguments  are failing...
  13.  
  14. I am using MS Quick C 2.5
  15.  
  16. I just want to be able to enter two file paths at the command line.
  17. Here is my code: 
  18.  
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21.  
  22.  
  23.  
  24. main(int argc, char *argv[],char *envp[])
  25. {
  26. FILE *ofp,*nfp;
  27. char ch;
  28.  
  29. gets(*argv);
  30.  
  31. if (argc!=3)
  32.   {
  33.   printf("Enter: <source> <destination>\n");
  34.   exit(1);
  35.   }
  36.  
  37. Code countinues but when I enter my command line input such as:
  38.  
  39. A:\readme.txt  A:\newfile.txt
  40.  
  41. I get my arvc error message above
  42. I'm sure I've missed something simple but it has me stumped.
  43. (win95 if OS matters.)
  44. Thanks in Advance!!
  45. Raymond Joh 
  46. ##############################################################
  47. Raymond Joh                  If you can't tie a good knot...
  48. Dslayer@gnn.com                     ...Tie a BUNCH of them!!!
  49. Dslayer@worldnet.att.net
  50. Home Page ==>>http://members.aol.com/ggjoh/index.htm
  51. ##############################################################
  52.  
  53.